//
//  ShopGoodsInforTableViewCell.m
//  GLGW_Shoping
//
//  Created by yang on 2018/11/20.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "ShopGoodsInforTableViewCell.h"
#import "GoodsNumChangeView.h"

@implementation ShopGoodsInforTableViewCell{
    GLGWButton * selectBut;
    GLGWLabel * goodsNameLabel;
    GLGWLabel * specificationsLabel;
    //
    GLGWLabel * piceLabel;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        selectBut = [[GLGWButton alloc] initInSuperView:self.contentView];
//        selectBut.backgroundColor = kRandomColor;
        selectBut.image_Name = @"icon_weixuanzhe";
        [selectBut mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView).offset(-kHeightProportion_In_iPhoneTriploid(10));
            make.left.equalTo(self.contentView.mas_left).offset(0);
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(50)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(50)));
        }];
        //
        goodsNameLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(kWidthProportion_In_iPhoneTriploid(50), kHeightProportion_In_iPhoneTriploid(11), KScreenWidth - kWidthProportion_In_iPhoneTriploid(65), kHeightProportion_In_iPhoneTriploid(20)) theFont:SYSTEMFONT(14) theColor:kColor_Rule_Black inSuperView:self];
//        goodsNameLabel.backgroundColor = kRandomColor;
        goodsNameLabel.text = @"三级螺纹钢 HRB400E 河钢";
        //
        specificationsLabel = [[GLGWLabel alloc] initWithFrame:CGRectMake(goodsNameLabel.x, kY_With_View(goodsNameLabel, 10), goodsNameLabel.width, kHeightProportion_In_iPhoneTriploid(17)) theFont:SYSTEMFONT(12) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
//        specificationsLabel.backgroundColor = kRandomColor;
        specificationsLabel.text = @"φ6*12";
        //
        GoodsNumChangeView * changeView = [[GoodsNumChangeView alloc] initWithFrame:CGRectMake(KScreenWidth - kWidthProportion_In_iPhoneTriploid(85), kY_With_View(specificationsLabel, 3), kWidthProportion_In_iPhoneTriploid(70), kHeightProportion_In_iPhoneTriploid(20)) inSuperView:self];
        //钱
        piceLabel = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:[UIColor colorWithHexString:@"#EC5353"] inSuperView:self.contentView];
        [piceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView.mas_left).offset(kWidthProportion_In_iPhoneTriploid(50));
            make.bottom.equalTo(self.contentView.mas_bottom).offset(-kHeightProportion_In_iPhoneTriploid(5));
            make.right.equalTo(changeView.mas_left).offset(-kWidthProportion_In_iPhoneTriploid(10));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        piceLabel.attributedText = [GLGWLabel bllChangeStr:@"¥3845 （4.69吨）" changewithStr:@"（4.69吨）" changeColoer:[UIColor colorWithHexString:@"#EC5353"] withFont:SYSTEMFONT(12)];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
